package pers.qianyu.month_202102.date_20210225;

/**
 * 867. 转置矩阵
 * https://leetcode-cn.com/problems/transpose-matrix/
 *
 * @author mizzle rain
 * @date 2021-02-25 10:18
 */
public class Transpose {
    public int[][] transpose(int[][] matrix) {
        int m = matrix.length, n = matrix[0].length;
        int[][] res = new int[n][m];
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                res[j][i] = matrix[i][j];
            }
        }
        return res;
    }
}
